package NGUYENNGOCHUNG;

import java.util.Scanner;

public class CapDoi {
	public static void main(String[] args) {

		System.out.println("Dang ky tham gia ket ban. ");
		Scanner scan = new Scanner(System.in);
		System.out.println("Nhap ten cua ban : ");
		String name = scan.nextLine();
		if (name.isEmpty()) {
			System.out.println("Ban chua nhap ten");
			return;
		} else {

		}

		scan = new Scanner(System.in);
		System.out.println("Nhap tuoi cua ban : ");
		String temp = scan.nextLine();
		if (temp.isEmpty()) {
			System.out.println("Ban chua nhap tuoi. ");
			return;
		} else {

		}
		int tuoi = Integer.parseInt(temp);

		scan = new Scanner(System.in);
		System.out
				.println("Nhap tinh trang hon nhan cua ban(chua co gia dinh or da ket hon) : ");
		String marry = scan.nextLine();
		if (marry.isEmpty()) {
			System.out.println("Ban chua nhap tinh trang hon nhan");
			return;
		} else {
		}
		scan = new Scanner(System.in);
		System.out.println("Nhap gioi tinh cua ban : ");
		String sex = scan.nextLine();
		if (sex.isEmpty()) {
			System.out.println("Ban chua nhap gioi tinh");
			return;
		} else {

		}

		if ((tuoi >= 22) && (marry.equals("chua co gia dinh"))
				&& (sex.equals("Nam"))) {
			System.out.println("Duoc phep tham gia.");
		} else if ((tuoi >= 19) && (marry.equals("chua co gia dinh"))
				&& (sex.equals("Nu"))) {
			System.out.println("Duoc phep tham gia.");
		} else if (tuoi < 19) {
			System.out.println("khong duoc phep tham gia.");
		} else {
			System.out.println("khong duoc phep tham gia");
		}
	}

}
